home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / rpm / rpmal.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-10-22  |  3.5 KB  |  140 lines

  1. #ifndef H_RPMAL
  2. #define H_RPMAL
  3.  
  4. /** \ingroup rpmdep rpmtrans
  5.  * \file lib/rpmal.h
  6.  * Structures used for managing added/available package lists.
  7.  */
  8.  
  9. /*@-exportlocal@*/
  10. /*@unchecked@*/
  11. extern int _rpmal_debug;
  12. /*@=exportlocal@*/
  13.  
  14. /**
  15.  */
  16. typedef /*@abstract@*/ struct rpmal_s *        rpmal;
  17.  
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21.  
  22. /**
  23.  * Initialize available packckages, items, and directory list.
  24.  * @param delta        no. of entries to add on each realloc
  25.  * @return al        new available list
  26.  */
  27. /*@-exportlocal@*/
  28. /*@only@*/
  29. rpmal rpmalCreate(int delta)
  30.     /*@*/;
  31. /*@=exportlocal@*/
  32.  
  33. /**
  34.  * Free available packages, items, and directory members.
  35.  * @param al        available list
  36.  * @return        NULL always
  37.  */
  38. /*@null@*/
  39. rpmal rpmalFree(/*@only@*/ /*@null@*/ rpmal al)
  40.     /*@globals fileSystem @*/
  41.     /*@modifies al, fileSystem @*/;
  42.  
  43. /**
  44.  * Delete package from available list.
  45.  * @param al        available list
  46.  * @param pkgKey    package key
  47.  */
  48. /*@-exportlocal@*/
  49. void rpmalDel(/*@null@*/ rpmal al, /*@null@*/ alKey pkgKey)
  50.     /*@globals fileSystem @*/
  51.     /*@modifies al, fileSystem @*/;
  52. /*@=exportlocal@*/
  53.  
  54. /**
  55.  * Add package to available list.
  56.  * @param alistp    address of available list
  57.  * @param pkgKey    package key, RPMAL_NOMATCH to force an append
  58.  * @param key        associated file name/python object
  59.  * @param provides    provides dependency set
  60.  * @param fi        file info set
  61.  * @param tscolor    transaction color bits
  62.  * @return        available package index
  63.  */
  64. alKey rpmalAdd(rpmal * alistp,
  65.         /*@dependent@*/ /*@null@*/ alKey pkgKey,
  66.         /*@dependent@*/ /*@null@*/ fnpyKey key,
  67.         /*@null@*/ rpmds provides, /*@null@*/ rpmfi fi,
  68.         uint_32 tscolor)
  69.     /*@globals fileSystem @*/
  70.     /*@modifies *alistp, provides, fi, fileSystem @*/;
  71.  
  72. /**
  73.  * Add package provides to available list index.
  74.  * @param al        available list
  75.  * @param pkgKey    package key
  76.  * @param provides    added package provides
  77.  * @param tscolor    transaction color bits
  78.  */
  79. /*@-exportlocal@*/
  80. void rpmalAddProvides(rpmal al,
  81.         /*@dependent@*/ /*@null@*/ alKey pkgKey,
  82.         /*@null@*/ rpmds provides, uint_32 tscolor)
  83.     /*@modifies al, provides @*/;
  84. /*@=exportlocal@*/
  85.  
  86. /**
  87.  * Generate index for available list.
  88.  * @param al        available list
  89.  */
  90. void rpmalMakeIndex(/*@null@*/ rpmal al)
  91.     /*@modifies al @*/;
  92.  
  93. /**
  94.  * Check added package file lists for package(s) that provide a file.
  95.  * @param al        available list
  96.  * @param ds        dependency set
  97.  * @retval keyp        added package key pointer (or NULL)
  98.  * @return        associated package key(s), NULL if none
  99.  */
  100. /*@-exportlocal@*/
  101. /*@only@*/ /*@null@*/
  102. fnpyKey * rpmalAllFileSatisfiesDepend(/*@null@*/ const rpmal al,
  103.         /*@null@*/ const rpmds ds, /*@null@*/ alKey * keyp)
  104.     /*@globals fileSystem @*/
  105.     /*@modifies al, *keyp, fileSystem @*/;
  106. /*@=exportlocal@*/
  107.  
  108. /**
  109.  * Check added package file lists for package(s) that have a provide.
  110.  * @param al        available list
  111.  * @param ds        dependency set
  112.  * @retval keyp        added package key pointer (or NULL)
  113.  * @return        associated package key(s), NULL if none
  114.  */
  115. /*@only@*/ /*@null@*/
  116. fnpyKey * rpmalAllSatisfiesDepend(const rpmal al, const rpmds ds,
  117.         /*@null@*/ alKey * keyp)
  118.     /*@globals fileSystem @*/
  119.     /*@modifies al, *keyp, fileSystem @*/;
  120.  
  121. /**
  122.  * Check added package file lists for first package that has a provide.
  123.  * @todo Eliminate.
  124.  * @param al        available list
  125.  * @param ds        dependency set
  126.  * @retval keyp        added package key pointer (or NULL)
  127.  * @return        associated package key, NULL if none
  128.  */
  129. /*@null@*/
  130. fnpyKey rpmalSatisfiesDepend(const rpmal al, const rpmds ds,
  131.         /*@null@*/ alKey * keyp)
  132.     /*@globals fileSystem @*/
  133.     /*@modifies al, *keyp, fileSystem @*/;
  134.  
  135. #ifdef __cplusplus
  136. }
  137. #endif
  138.  
  139. #endif    /* H_RPMAL */
  140.